package com.self.test.thread;

public class SubMoneyThread implements Runnable {
	private Account account;    // 存入账户
    private double money;       // 存入金额

    public SubMoneyThread(Account account, double money) {
        this.account = account;
        this.money = money;
    }

    @Override
    public void run() {
    	synchronized (account) {
    		account.subMoney(money);
		}
    }
}
